<?php
class page_base {

	private $titre;
	private $style=array('bootstrap-responsive', 'bootstrap');
	//private $script=array('application', 'bootstrap-alert', 'bootstrap-button', 'bootstrap-carousel', 'bootstrap-collapse','bootstrap-dropdown','bootstrap-modal','bootstrap-popover','bootstrap-scrollspy','bootstrap-tab','bootstrap-tooltip','bootstrap-transition','bootstrap-typeahead','bootstrap.min','html5','jquery-1.7.1.min','jquery-ui-1.8.18','jquery.smooth-scroll.min','lightbox');
	private $corps;
	private $page;

	public function __construct($p) {
		$this->page = $p;
	}

	/******** Gestion des setters  *******************/
	public function __set($propriete, $valeur) {
		switch ($propriete) {
			case 'style' : {
				$this->style[count($this->style)+1] = $valeur;
				break;
			}
			case 'script' : {
				$this->script[count($this->script)+1] = $valeur;
				break;
			}
			case 'corps' : {
				$this->corps = $valeur;
				break;
			}
			case 'titre' : {
				$this->titre = $valeur;
				break;
			}
		}
	}
	/******** Gestion du titre  *******************/
	private function affiche_titre() {
		echo $this->titre;
	}

	/*************Gestion des styles *********************/
	private function affiche_style() {
		foreach ($this->style as $s) {
			echo "<link rel='stylesheet' href='css/".$s.".css' />\n";
		}
	}
	
	/*************Gestion des scripts *********************/
	//private function affiche_script() {
		//foreach ($this->script as $js) {
			//echo "<script src='js/".$js.".js'></script>\n";
		//}
	//}
	
	/************** Affichage du pied de la page ***************************/
	private function affiche_footer() {
		?>
<footer class="row">
    <div>
      <div class="span4">
        <div class="is-padded">
          <nav>
            <h2>Navigation</h2>
            <hr>
            <ul>
              <li><a href="#">Home</a></li>
              <li><a href="#">Services</a></li>
              <li><a href="#">Portfolio</a></li>
              <li><a href="#">Contact</a></li>
              <li><a href="#">About</a></li>
            </ul>
          </nav>
        </div>
      </div>
      <div class="span4">
        <div class="is-padded">
          <h2>Twitter</h2>
          <hr>
          <a href="#">@AwfulMedia</a>
          <p>This is what my tweet looks like on this website. Tweet tweet. Twitter Twatter.</p>
          <em>3 days ago</em><br>
          <br>
          <a href="#">@AwfulMedia</a>
          <p>This is what my tweet looks like on this website. Tweet tweet. Twitter Twatter.</p>
          <em>3 days ago</em> </div>
      </div>
      <div class="span4">
        <div class="is-padded">
          <h2>Details</h2>
          <blockquote>Respond is a fully responsive website template utilizing Twitter's Bootstrap framework. What does that mean? First of all, the website will respond according to the size of the viewers browser window. Go on, try it out. Resize your window. On top of that, the framework offers loads of ready-to-go features. Check it out with the button below. <br>
            <br>
            <em>- AwfulMedia.com</em> </blockquote>
        </div>
      </div>
    </div>
    <p> &copy;2012 Your Company.<br>
      Design by <a href="http://www.awfulmedia.com">AwfulMedia.com</a> </p>
  </footer>
		<?php
	}
	/************** Affichage du corps de la page ***************************/
	private function affiche_corp() {
		
			echo utf8_encode($this->corps);
			
		}
	/************** Affichage du Menu ***************************/
		private function affiche_Menu() {
?>	
<div class="navbar navbar-fixed-top">
  <div class="navbar-inner">
    <div class="container"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <a class="brand" href="index.html"><span class="color-highlight">R</span>espond 1.5</a>
      <div class="nav-collapse">
        <ul class="nav pull-right">
          <li class="active"><a href="index.html">Home</a></li>
          <li><a href="services.html">Services</a></li>
          <li><a href="portfolio.html">Portfolio</a></li>
          <li><a href="contact.html">Contact</a></li>
          <li><a href="about.html">About</a></li>
        </ul>
      </div>
      <!--/.nav-collapse -->
    </div>
  </div>
</div>
<?php 				
		}
	/************** Affichage du carousel ***************************/
	private function affiche_carousel() {
?>	
  <!--Start Carousel-->
  <div id="myCarousel" class="carousel slide">
    <div class="carousel-inner">
      <div class="item active"> <img src="img/featured/1.jpg" alt="">
        <div class="carousel-caption">
          <h4>First Thumbnail label</h4>
          <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
        </div>
      </div>
      <div class="item"> <img src="img/featured/2.jpg" alt="">
        <div class="carousel-caption">
          <h4>Second Thumbnail label</h4>
          <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
        </div>
      </div>
    </div>
    <a class="left carousel-control" href="#myCarousel" data-slide="prev"><img src="img/arrow.png" alt=""></a> <a class="right carousel-control" href="#myCarousel" data-slide="next"><img src="img/arrow2.png" alt=""></a> </div>
  <!--End Carousel-->
<?php	
}
	/************** Affichage de la Boite 1 ***************************/
	private function affiche_box1() {
	?>
  <hr>
  <div class="row">
    <div class="span4">
      <h3>Deep Sky<small> By <a href="#">Srawat56</a></small></h3>
      <a rel="lightbox" href="img/thumb1.jpg"><img src="img/thumb1.jpg" alt=""></a> </div>
    <div class="span4">
      <h3>Nature's Valley<small> By <a href="#">Paul venter</a></small></h3>
      <a rel="lightbox" href="img/thumb2.jpg"><img src="img/thumb2.jpg" alt=""></a> </div>
    <div class="span4">
      <h3>Details</h3>
      <blockquote>Respond is a fully responsive website template utilizing Twitter's Bootstrap framework. What does that mean? First of all, the website will respond according to the size of the viewers browser window. Go on, try it out. Resize your window. On top of that, the framework offers loads of ready-to-go features. Check it out with the button below. <br>
        <br>
        <em>- AwfulMedia.com</em> </blockquote>
      <p><a class="btn" href="#">All Features &raquo;</a></p>
    </div>
  </div>
	<?php	
}

	/************** Affichage de la Boite 2 ***************************/
	private function affiche_box2() {
	?>
  <div class="row">
    <div class="span6 thumb-list"> <a rel="lightbox" href="img/thumb-small01.png"><img src="img/thumb-small01.png" alt=""></a>
      <h3><a href="#">This Should Be Your Title.</a></h3>
      <p>This will be the description or something I guess. I don't know. Your choice.You could summarize something here. Keep it simple. Just a few short sentences. Maybe one large one? No, a few short ones.</p>
    </div>
    <div class="span6 thumb-list"> <a rel="lightbox" href="img/thumb-small02.png"><img src="img/thumb-small02.png" alt=""></a>
      <h3><a href="#">This Should Be Your Title.</a></h3>
      <p>This will be the description or something I guess. I don't know. Your choice.</p>
      <a href="#" class="btn">Details</a> </div>
  </div>
	<?php	
}

	/************** Affichage de la Boite 3 ***************************/
	private function affiche_box3() {
	?>
<div class="row">
    <div class="span6 thumb-list"> <a rel="lightbox" href="img/thumb-small01.png"><img src="img/thumb-small01.png" alt=""></a>
      <h3><a href="#">This Should Be Your Title.</a></h3>
      <p>This will be the description or something I guess. I don't know. Your choice.</p>
      <a href="#" class="btn">Details</a> </div>
    <div class="span6 thumb-list"> <a rel="lightbox" href="img/thumb-small02.png"><img src="img/thumb-small02.png" alt=""></a>
      <h3><a href="#">This Should Be Your Title.</a></h3>
      <p>This will be the description or something I guess. I don't know. Your choice.</p>
      <a href="#" class="btn">Details</a> </div>
  </div>
	<?php
	}
	
	/******************** Fonction permettant l'affichage de la page **************/
		public function affiche() {

		?>
			<!DOCTYPE html>
			<html lang='fr'>
				<head>
					<title>
						<?php $this->affiche_titre(); ?>
					</title>			
	<meta name="viewport" content="width=device-width, initial-scale=1.0">		
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="identifier-url" content="http://www.usep49.fr/" />
	<meta name="title" content="Les écoles font la courses !" />
	<meta name="description" content="L'association USEP49 permet aux écoles de faire participer leurs élèves à des courses organisées." />
	<meta name="abstract" content="L'association USEP49 permet aux écoles de faire participer leurs élèves à des courses organisées." />
	<meta name="keywords" content="association, usep, 49, maine et loire, cross, école, courses, élèves" />
	<meta name="revisit-after" content="5" />
	<meta name="language" content="FR" />
	<meta name="copyright" content="© 2014 USEP49" />
	<meta name="robots" content="All" />
	<!--[if lt IE 9]><script src="js/html5.js"></script><![endif]-->
	<link href='http://fonts.googleapis.com/css?family=Lato:300' rel='stylesheet' type='text/css'>
						<?php 
						$this->affiche_style(); 
						?>					
				</head>
					<body>	
						<?php $this->affiche_Menu(); ?>							
				<div class="container">
						<?php $this->affiche_carousel(); ?>	
						<?php $this->affiche_corp(); ?>					
						<?php $this->affiche_box1();?>
						<?php $this->affiche_box2();?>
						<?php $this->affiche_box3();?>
				<footer>
						<?php  $this->affiche_footer(); ?>
				</div>
				</footer>
				<script src="js/jquery-1.7.1.min.js"></script>
 <script src="js/bootstrap-transition.js"></script>
<script src="js/bootstrap-carousel.js"></script>
<script src="js/bootstrap-alert.js"></script>
<script src="js/bootstrap-modal.js"></script>
<script src="js/bootstrap-dropdown.js"></script>
<script src="js/bootstrap-scrollspy.js"></script>
<script src="js/bootstrap-tab.js"></script>
<script src="js/bootstrap-tooltip.js"></script>
<script src="js/bootstrap-popover.js"></script>
<script src="js/bootstrap-button.js"></script>
<script src="js/bootstrap-collapse.js"></script>
<script src="js/bootstrap-typeahead.js"></script>
<script src="js/jquery-ui-1.8.18.custom.min.js"></script>
<script src="js/jquery.smooth-scroll.min.js"></script>
<script src="js/lightbox.js"></script>
				<script>
				$('.carousel').carousel({
 				 interval: 5000})
				</script>
				</body>
			</html>
		<?php
	}
}
?>